package com.cheng.example.geektime.designpatterns.j57.eventbus;

import com.google.common.eventbus.Subscribe;

/**
 * 发放新的用户体验金
 */
public class RegPromotionObserver {
    private PromotionService promotionService = new PromotionService();//依赖注入

    @Subscribe
    public void handleRegSuccess(Long userId) {
        promotionService.issueNewUserExperienceCash(userId);
    }


    @Subscribe
    public void handleRegSuccess1(Object parent) {
        promotionService.issueNewUserExperienceCash(1);
    }


    class Parent{

    }


    class  Son extends Parent {

    }

}
